import { getProducts } from '../../api/products'
const state = {
    products: []
}
const getters = {
    
}
const mutations = {
    setProducts(state, payload) {
        state.products = payload
    }
}
const actions = {
    async getAllProducts({ commit }, type) {
        const { data } = await getProducts(type)
        commit('setProducts', data.data)
    }
}

export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
}
